bin_PROGRAMS = spicy-stats spicy-screenshot spicy-usb
AUTOMAKE_OPTIONS=subdir-objects

EXTRA_DIST = meson.build

TOOLS_CPPFLAGS =			\
	-DSPICE_COMPILATION		\
	-I$(top_builddir)/src		\
	-I$(top_srcdir)			\
	-I$(top_srcdir)/src		\
	$(COMMON_CFLAGS)		\
	$(GLIB2_CFLAGS)			\
	$(GIO_CFLAGS)			\
	$(SMARTCARD_CFLAGS)		\
	$(SPICE_CFLAGS)			\
	$($LIBCURL_CFLAGS)              \
	$(XRANDR_CFLAGS)                \
	$(NULL)

if WITH_GTK
bin_PROGRAMS += spicy
TOOLS_CPPFLAGS += $(GTK_CFLAGS)
endif

spicy_SOURCES =					  \
	vcd-main-no-ui.c 			  \
	spicy.h            			  \
	spicy.c				    	  \
	spicy-connect.h 			  \
	spicy-connect.c 			  \
	spice-cmdline.h				  \
	spice-cmdline.c				  \
	vcd-linux-ui/vcd-start-window.h			  \
	vcd-linux-ui/vcd-start-window.c 		  \
	vcd-linux-ui/vcd-logined-window.h 		  \
	vcd-linux-ui/vcd-logined-window.c 		  \
	vcd-common-api/vcd-get-vm-info.h 			  \
	vcd-common-api/vcd-get-vm-info.c 			  \
	vcd-common-api/vcd-refresh-vm-info.h 		  \
	vcd-common-api/vcd-refresh-vm-info.c 		  \
	vcd-common-api/vcd-vm-connect.h 			  \
	vcd-common-api/vcd-vm-connect.c 			  \
	vcd-common-api/vcd-vm-rdp-connect.h 		  \
	vcd-common-api/vcd-vm-rdp-connect.c 		  \
	vcd-common-api/vcd-get-login-ticket.h 		  \
	vcd-common-api/vcd-get-login-ticket.c 		  \
	vcd-common-api/vcd-new-login-mode.h 		  \
	vcd-common-api/vcd-new-login-mode.c 		  \
	vcd-common-api/vcd-common.h 				  \
	vcd-common-api/vcd-common.c 				  \
	vcd-common-api/vcd-conf/vcd-conf.h			  \
	vcd-common-api/vcd-conf/vcd-conf.c			  \
	vcd-common-api/vcd-log.h 					  \
	vcd-common-api/vcd-log.c 					  \
	vcd-common-api/vcd-download.h				  \
	vcd-common-api/vcd-download.c 				  \
	vcd-common-api/vcd-json-parser.h 			  \
	vcd-common-api/vcd-json-parser.c 			  \
	vcd-common-api/vcd-send-heartbeat.c 			  \
	vcd-common-api/vcd-json-heartbeat.h 			  \
	vcd-common-api/vcd-css.h 					  \
	vcd-common-api/vcd-css.c 					  \
	vcd-common-api/vcd-util.h					  \
	vcd-common-api/vcd-vm-status-control.h \
	vcd-common-api/vcd-vm-status-control.c \
	vcd-common-api/vcd-usb-redir.c\
	vcd-common-api/trace-signals/libdebug.h \
	vcd-common-api/trace-signals/libdebug.c \
	vcd-common-api/vcd-ping.h \
	vcd-common-api/vcd-ping.c \
	vcd-common-api/vcd-ping-impl/vcd-ping-linux.c \
	vcd-common-api/vcd-ping-impl/vcd-ping-win32.c \
	vcd-common-api/vcd-com-reconnect.h \
	vcd-common-api/vcd-com-reconnect.c \
	vcd-common-api/vcd-crypto.h \
	vcd-common-api/vcd-crypto.c \
	vcd-common-api/easylog/easylog.h \
	vcd-common-api/easylog/easylog.c \
	vcd-common-api/vcd-topbar/vcd-topbar.c \
	vcd-linux-ui/vcd-setting-window/setting-network/vcd-setting-network.h \
	vcd-linux-ui/vcd-setting-window/setting-network/vcd-setting-network.c \
	vcd-linux-ui/vcd-setting-window/setting-network/vcd-node.h \
	vcd-linux-ui/vcd-setting-window/setting-network/vcd-node.c \
	vcd-linux-ui/vcd-setting-window/setting-network/vcd-wifi.h \
	vcd-linux-ui/vcd-setting-window/setting-network/vcd-wifi.c \
	vcd-linux-ui/vcd-setting-window/setting-network/vcd-wire.h \
	vcd-linux-ui/vcd-setting-window/setting-network/vcd-wire.c \
	vcd-linux-ui/vcd-setting-window/setting-close/vcd-setting-close.h \
	vcd-linux-ui/vcd-setting-window/setting-close/vcd-setting-close.c \
	vcd-linux-ui/vcd-setting-window/setting-diagnosis/vcd-diagnosis.h \
	vcd-linux-ui/vcd-setting-window/setting-diagnosis/vcd-diagnosis.c \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-setting-main.h \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-setting-main.c \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-sys-info.h \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-sys-info.c \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-display.h \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-display.c \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-xrandr.h \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-xrandr.c \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-sound.h \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-sound.c \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-sys-upgrade.h \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-sys-upgrade.c \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-login-setting.h \
	vcd-linux-ui/vcd-setting-window/setting-main/vcd-login-setting.c \
	vcd-linux-ui/vcd-setting-window/setting-other/vcd-setting-other.h \
	vcd-linux-ui/vcd-setting-window/setting-other/vcd-setting-other.c \
	vcd-linux-ui/vcd-setting-window/setting-other/vcd-other-topbar.h \
	vcd-linux-ui/vcd-setting-window/setting-other/vcd-other-topbar.c \
	vcd-linux-ui/vcd-setting-window/vcd-setting-window.h \
	vcd-linux-ui/vcd-setting-window/vcd-setting-window.c \
	vcd-linux-ui/vcd-passwd-window.h \
	vcd-linux-ui/vcd-passwd-window.c \
	vcd-linux-ui/vcd-window-timed-revealer.h \
	vcd-linux-ui/vcd-window-timed-revealer.c \
	vcd-linux-ui/vcd-message-dialog.h \
	vcd-linux-ui/vcd-message-dialog.c \
	vcd-linux-ui/vcd-webkit.h \
	vcd-linux-ui/vcd-webkit.c \
	vcd-rdp/vcd-rdp.h \
	vcd-rdp/vcd-rdp.c \
	vcd-rdp/vcd-error.h \
	vcd-rdp/vcd-error.c \
	$(NULL)

spicy_LDADD =				\
	$(top_builddir)/src/libspice-client-gtk-3.0.la	\
	$(top_builddir)/src/libspice-client-glib-2.0.la	\
	$(GTK_LIBS) \
	$(GSTAUDIO_LIBS) \
	$(GSTVIDEO_LIBS) \
	$(LIBCURL_LIBS) \
	$(XRANDR_LIBS) \
	$(LIBCURL_LIBS)			\
	-lcrypto				\
	-lpthread  				\
	$(JSON_LIBS) 			\
	$(USBREDIR_LIBS)        \
	$(LOG4C_LIBS)           \
	$(SSL_LIBS)             \
	${WEBKIT2GTK_LIBS}      \
	$(NULL)

# FIXME: GtkAction and lots of GtkUIManager APIs are deprecated
spicy_CPPFLAGS =			\
	$(TOOLS_CPPFLAGS)		\
	$(GSTAUDIO_CFLAGS)		\
	$(GSTVIDEO_CFLAGS)		\
	-DSPICE_DISABLE_DEPRECATED	\
	-Wno-deprecated-declarations	\
	-pthread                 \
	$(JSON_CFLAGS)           \
	$(USBREDIR_CFLAGS)       \
	$(LOG4C_CFLAGS)         \
	$(SSL_CFLAGS)           \  
	${WEBKIT2GTK_CFLAGS}    \
$(NULL)

spicy_screenshot_SOURCES =	\
	spicy-screenshot.c		\
	spice-cmdline.h			\
	spice-cmdline.c			\
	$(NULL)

spicy_screenshot_LDADD =		\
	$(top_builddir)/src/libspice-client-glib-2.0.la	\
	$(GOBJECT2_LIBS)		\
	$(NULL)

spicy_screenshot_CPPFLAGS =		\
	$(TOOLS_CPPFLAGS)		\
	$(NULL)

spicy_stats_SOURCES =			\
	spicy-stats.c			\
	spice-cmdline.h			\
	spice-cmdline.c			\
	$(NULL)

spicy_stats_LDADD =			\
	$(top_builddir)/src/libspice-client-glib-2.0.la	\
	$(GOBJECT2_LIBS) \
	$(NULL)

spicy_stats_CPPFLAGS =			\
	$(TOOLS_CPPFLAGS)		\
	$(NULL)


spicy_usb_SOURCES =	\
    vcd-common-api/vcd-usb-redir.c \
    vcd-common-api/vcd-log.c  \
	vcd-common-api/easylog/easylog.c \
	vcd-common-api/vcd-topbar/vcd-topbar.c \
	vcd-common-api/vcd-crypto.h  \
    vcd-common-api/vcd-crypto.c  \
    vcd-common-api/vcd-conf/vcd-conf.h \
    vcd-common-api/vcd-conf/vcd-conf.c \
    vcd-linux-ui/vcd-window-timed-revealer.c \
    vcd-usb/vcd-usb-network.c \
    vcd-usb/vcd-usb-network.h \
    vcd-usb/vcd-usb-main.c \
    vcd-usb/vcd-usb-common.h \
    $(NULL)

spicy_usb_LDADD = \
	$(spicy_LDADD) \
	$(NULL)

spicy_usb_CPPFLAGS = 	\ 
	$(spicy_CPPFLAGS)  \
	$(NULL)

-include $(top_srcdir)/git.mk
